<?php date_default_timezone_set('Australia/Brisbane'); ?>
<div id="assessment_grid">
	<h1>Assessment Items <a href="<?php echo site_url('assessment/create'); ?>">Create</a></h1>
	
		<div id="atsplit1">
		<h3>Past Assessments</h3>
		<ul>
	<?php foreach($past_items as $key => $item): ?>
		<?php 
		$format = 'Y-m-d H:i:s';
		$date = DateTime::createFromFormat($format, $item['due_date']);
		$date = $date->format('d/F');
		?>
		<li><a href="<?php echo site_url("/assessment/modify/".$item['assessment_id']); ?>"><?php echo $item['assessment_title']; ?></a> : Due on <?php echo $date; ?></li>
	<?php endforeach?>
		</ul>
		</div>
		<div id="atsplit2">
		<h3>Future Assessments</h3>
		<ul>
		<?php
		$nowU = date('U');
		$nowU = $nowU + 604800;
		foreach($future_items as $key => $item): ?>
		<?php 
		$format = 'Y-m-d H:i:s';
		$date = DateTime::createFromFormat($format, $item['due_date']);
		$dateU = $date->format('U');
		$date = $date->format('d/F');
		if($nowU >= $dateU){} 
		?>
		<li><a href="<?php echo site_url("/assessment/modify/".$item['assessment_id']); ?>"><?php echo $item['assessment_title']; ?></a> : <?php if($nowU >= $dateU){echo '<span class="r">';} ?>Due on <?php echo $date; if($nowU >= $dateU){echo '</span>';}?></li>
	<?php endforeach?>
		</ul>
		</div>
</div>